import QtQuick 2.0
import QtGraphicalEffects 1.0

//圆角图片：Rectangle+OpacityMask+Image
Rectangle{
    property string source:null
    color: "transparent"
    radius: Math.min(width,height) / 2

    Rectangle{
        id:maskComponent
        radius: parent.radius
        visible: false
        anchors.fill: parent
    }

    Image{
        id:imgComponent
        source: parent.source
        width: width
        height: height
        visible: false
    }

    OpacityMask{
        source: imgComponent
        maskSource: maskComponent
        anchors.fill: parent
    }
}
